{extend name="default/base/base_seller" /}

{block name="seller_main"}
<form method="get" action="" class="layui-form">
    <table class="search-form">
        <tr>
            <th>&nbsp;
                <select name="search_field_name" style="display: inline; margin-top:-25%;margin-left: 10%;">
                    <option {if $search_field_name==
                    'member_name'}selected='selected'{/if} value="member_name">大客户名称</option>
                    <option {if $search_field_name==
                    'member_mobile'}selected='selected'{/if} value="member_mobile">手机号码</option>
                </select>

            </th>
            <td class="w160">
                <input type="text" value="{$search_field_value}" name="search_field_value" class="txt">
            </td>
            <th>排序</th>
            <td>
                <select name="search_sort" style="display: inline;">
                    <option value="">{$Think.lang.ds_sort}</option>
                    <option {if $search_sort==
                    'member_logintime desc'}selected='selected'{/if} value="member_logintime desc">最后登录</option>
                    <option {if $search_sort==
                    'member_loginnum desc'}selected='selected'{/if} value="member_loginnum desc">登录次数</option>
                </select>
            </td>

            <td class="tc w70">
                <input type="submit" class="submit" value="{$Think.lang.ds_search}"/>
            </td>
            <td><a href="{:url('memberda/index')}" class="dssc-btn dssc-btn-acidblue ml5 mr5">
                <p>取消</p></a></td>
            <td><a href="javascript:void(0);" class="dssc-btn dssc-btn-acidblue ml5 mr5" onclick="add_son_member();"><p>
                导入</p></a></td>
        </tr>
    </table>
</form>


<table class="dssc-default-table">
    <thead>
    <tr ds_type="table_header">

        <th class="w180">服务开始时间</th>
        <th class="w150" style="margin-left: 20px;">服务结束时间</th>
        <th class="w180" colspan="2">会员</th>
        <th class="w180">登录次数</th>
        <th class="w180">最后登录</th>
        <th class="w180">登录</th>
        <th class="w300">{$Think.lang.ds_handle}</th>
    </tr>

    </thead>

    <tbody>
    {notempty name="member_list"}
    <?php $index=1; foreach($member_list as $k=>$val){ ?>

    <tr>

        <td>{$val.server_da_create_time ? date('Y-m-d', $val.server_da_create_time) : ''}</td>
        <td style="margin-left: 30px;">{$val.server_da_end_time ? date('Y-m-d', $val.server_da_end_time) : ''}</td>
        <td>
            <div class="size-44x44" style="margin-right: 10px;">
                  <span class="thumb"><i></i>

                      {if condition="($val.member_avatar!='')"}
                             <img src="{:get_member_avatar($val.member_avatar)}?{:microtime()}" width="44" height="44"/>
                      {else}
                             <img src="http://33wang.douyinhot.com/03a18202002091420493484.jpg" width="44" height="44"/>
                      {/if}
                  </span>
            </div>
        </td>

        <td style="color: black;" class="tl">
            <p class="name"><strong>{$val.member_name}</strong></p>
            <p class="smallfont">注册时间:&nbsp;{$val.member_addtime}</p>
        </td>
        <td>{$val.member_loginnum}</td>
        <td><p>{$val.member_logintime}</p>
            <p>{$val.member_login_ip}</p>
        </td>

        <td>{if $val.member_state == 1}允许{else/}禁止{/if}</td>


        <td class="dscs-table-handle">
            <span><a href="{:url('memberda/show',['member_id'=>$val.member_id])}" class="btn-green"><p>查看</p></a></span>
            <span> <a href="javascript:void(0);" onclick="set_server_time({$val['member_id']});" class="btn-blue"><p>时间设置</p></a></span>
            <span> <a href="javascript:void(0);" onclick="ds_ajaxget_confirm('{:url('Memberda/remove_son_member',['member_id'=>$val.member_id])}','是否要移除该用户吗？');" class="btn-red"><p>移除</p></a></span>
        </td>
    </tr>
    <tr style="display:none;">
        <td colspan="7">
            <div class="dssc-goods-sku ps-container"></div>
        </td>
    </tr>
    <?php $index++; }?>
    {else /}
    <tr>
        <td colspan="7" class="norecord">
            <div class="warning-option"><i class="iconfont">&#xe64c;</i><span>{$Think.lang.no_record}</span></div>
        </td>
    </tr>

    </tbody>
    <tfoot>
    <tr>
        <td colspan="7">
            <div class="pagination">{$show_page}</div>
        </td>
    </tr>
    {/notempty}
    </tfoot>
</table>


<script>
    //设置免费服务时间
    function set_server_time(ids_str) {
        _uri = HOMESITEURL + "/Memberda/set_server_time?member_id=" + ids_str;
        dsLayerOpen(_uri, '设置免费服务时间', '610px', '480px');
    }

    //添加下级用户
    function add_son_member() {
        _uri = HOMESITEURL + "/Memberda/add_son_member";
        dsLayerOpen(_uri, '添加下级用户', '909px', '502px');
    }

    /**
     * Layer 通用ifram弹出窗口
     */
    function dsLayerOpen(url, title, width, height) {
        if (!width) width = '900px';
        if (!height) height = '500px';
        layer.open({
            type: 2,
            title: title,
            area: [width, height],
            fixed: false, //不固定
            maxmin: true,
            content: url
        });
    }
</script>


{/block}
